<template>
  <div class="content">
    <div class="login">
      <h2>用户登录</h2>
      <div class="input">
        <div class="login_box">
          <input type="text" required />
          <label>用户名</label>
        </div>
        <div class="login_box">
          <input type="password" required="required" />
          <label>密码</label>
        </div>
      </div>
      <a href="javascript:;" @click="login()"
        >登录
        <span></span>
        <span></span>
        <span></span>
        <span></span>
      </a>
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具 js，第三方插件 js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import 引入的组件需要注入到对象中才能使用
  components: {},
  props: {},
  data() {
    //这里存放数据
    return {};
  },
  //计算属性 类似于 data 概念
  computed: {},
  //监控 data 中的数据变化
  watch: {},
  //方法集合
  methods: {
    login() {
      this.$router.push("/");
    },
  },
  //生命周期 - 创建完成（可以访问当前 this 实例）
  created() {},
  //生命周期 - 挂载完成（可以访问 DOM 元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有 keep-alive 缓存功能，这个函数会触发
};
</script>
<style  scoped>
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei";
}

.content {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(#141e30, #243b55);
}

.login {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 400px;
  padding: 30px;
  background-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.4);
}

.login h2 {
  color: #fff;
  margin-bottom: 20px;
}

.login .login_box {
  position: relative;
  width: 100%;
}

.login .login_box input {
  width: 100%;
  padding: 10px 10px;
  outline: none;
  border: none;
  margin-bottom: 30px;
  color: #fff;
  font-size: 16px;
  border-bottom: 1px solid #fff;
  background-color: transparent;
}

.login .login_box label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px 0;
  color: #fff;
  pointer-events: none;
  transition: all 0.5s;
}

.login .login_box input:focus + label,
.login .login_box input:valid + label {
  top: -20px;
  color: #03e9f4;
  font-size: 12px;
}

.login a {
  text-decoration: none;
  color: #03e9f4;
  position: relative;
  transition: all 0.5s;
  padding: 10px 20px;
  overflow: hidden;
}

.login a:hover {
  color: #fff;
  border-radius: 5px;
  background-color: #03e9f4;
  box-shadow: 0 0 5px #03e9f4, 0 0 25px #03e9f4, 0 0 50px #03e9f4,
    0 0 100px #03e9f4;
}

.login span {
  position: absolute;
}

.login a span:first-child {
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, #03e9f4);
  animation: move1 1s linear infinite;
}

.login a span:nth-child(2) {
  right: 0;
  top: -100%;
  width: 2px;
  height: 100%;
  background: linear-gradient(transparent, #03e9f4);
  animation: move2 1s linear 0.25s infinite;
}

.login a span:nth-child(3) {
  right: -100%;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to left, transparent, #03e9f4);
  animation: move3 1s linear 0.5s infinite;
}

.login a span:nth-child(4) {
  left: 0;
  bottom: -100%;
  width: 2px;
  height: 100%;
  background: linear-gradient(#03e9f4, transparent);
  animation: move4 1s linear 0.75s infinite;
}

@keyframes move1 {
  0% {
    left: -100%;
  }
  50%,
  100% {
    left: 100%;
  }
}
@keyframes move2 {
  0% {
    top: -100%;
  }

  50%,
  100% {
    top: 100%;
  }
}

@keyframes move3 {
  0% {
    right: -100%;
  }

  50%,
  100% {
    right: 100%;
  }
}

@keyframes move4 {
  0% {
    bottom: -100%;
  }

  50%,
  100% {
    bottom: 100%;
  }
}
</style>